package com.zbkj.common.request;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 礼品卡模版请求对象
 *
 * @author Swallows
 * @date 2022-08-17 09:57
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel("礼品卡模版请求对象")
public class StoreGiftCardRequest implements Serializable {

    private static final long serialVersionUID=1L;

    private Integer id;

    @ApiModelProperty(value = "礼品卡名称", required = true)
    @NotBlank(message = "请填写礼品卡名称")
    @Length(max = 64, message = "礼品卡名称长度不能超过64个字符")
    private String name;

    @ApiModelProperty(value = "兑换的礼品卡面值", required = true)
    @NotNull(message = "请填写礼品卡兑换的优惠券面值")
    @DecimalMax(value = "99999.99", message = "礼品卡面值不能大于99999.99")
    private BigDecimal money;

    @ApiModelProperty(value = "礼品卡背景图 主要用于电子卡展示")
    private String image;

    @ApiModelProperty(value = "礼品卡类型 1 电子卡 2 实体卡", required = true)
    @Range(min = 1, max = 2, message = "请选择礼品卡类型")
    private Integer cardType;

    @Range(min = 1, max = 3, message = "请选择礼品卡使用类型")
    @ApiModelProperty(value = "使用类型 1 储值卡, 2 指定商品卡, 3 指定品类卡", required = true)
    private Integer useType;

    @ApiModelProperty(value = "主键id 商品id/分类id", required = true)
    private String primaryKey;

    @ApiModelProperty(value = "是否固定使用时间, 默认0 否， 1是", required = true)
    @NotNull(message = "请设置是否固定使用时间")
    private Boolean isFixedTime;

    @ApiModelProperty(value = "可使用时间范围 开始时间")
    private Date useStartTime;

    @ApiModelProperty(value = "可使用时间范围 结束时间")
    private Date useEndTime;

    @ApiModelProperty(value = "天数")
    @Max(value = 999, message = "天数不能超过999天")
    private Integer day;

    @ApiModelProperty(value = "排序", required = true)
    @NotNull(message = "排序不能为空")
    @Min(value = 0, message = "排序不能小于0")
    private Integer sort;

    @ApiModelProperty(value = "状态（0：关闭，1：开启）")
    @NotNull(message = "优惠券状态不能为空")
    private Boolean status;

}
